package com.wefiesta.app;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.AdapterView;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;

public class AboutActivity extends Fragment implements OnItemClickListener {
	ListView listView;
	View vw_layout;

	private TextView tvtTotal;
	
	@Override
	public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
		
	}
	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
		
		if (container == null) {
			return null;
		}
		
		vw_layout = inflater.inflate(R.layout.activity_about, container, false);
		
		//creating events
		this.onClickTextVisiblity(R.id.txt_header1, R.id.txt_content1);
		//participaing and contributing
		this.onClickTextVisiblity(R.id.txt_header2, R.id.txt_content2);
		//Inviting friends
		this.onClickTextVisiblity(R.id.txt_header3, R.id.txt_content3);

		
		return vw_layout;
	}
	
	private void onClickTextVisiblity(int textHeader, final int textContent){
		TextView contentButton = (TextView)this.vw_layout.findViewById(textHeader);
		contentButton.setOnClickListener(new OnClickListener() {
            public void onClick(final View v) {
            TextView content  = (TextView)vw_layout.findViewById(textContent);
	            if(content.getVisibility() == 0){
	            	content.setVisibility(TextView.GONE);
	            }else{
	            	content.setVisibility(TextView.VISIBLE);
	            }
            }
        });
	}

}
